



select * from M_Tags

select * from M_Options


select * from m_categorys

delete  from M_PostCategoryRels

delete from M_Categorys

set IDENTITY_INSERT m_categorys on

insert into M_Categorys(Id, Name, Slug, Count, Description, ParentId)
select Id, Name, Slug, Count, Description,(case when ParentId=0 then null else ParentId end) as ParentId from WednNET.dbo.W_Terms where Type=1

set IDENTITY_INSERT m_categorys off



set IDENTITY_INSERT M_Options on
insert into M_Options(Id, Name, Value, Enabled)
select Id, Name, Value, Enabled from Micua.dbo.m_options
set IDENTITY_INSERT M_Options off


select * from Micua.dbo.M_Posts



set IDENTITY_INSERT M_Tags on

insert into M_Tags(Id, Name, Slug, Count, Description)
select Id, Name, Slug, Count, Description from WednNET.dbo.W_Terms where Type=0

set IDENTITY_INSERT M_Tags off
select * from WednNET.dbo.W_Terms where Type=0


select * from M_Tags
ALTER TABLE [dbo].[M_Options]
ADD CONSTRAINT [PK_M_Options]
    PRIMARY KEY CLUSTERED ([Id], [Name] ASC);
GO

select * from M_PostCategoryRels
select * from M_PostTagRels